using System.Data.Entity.ModelConfiguration;
using Turquoise.Entities.Data;

namespace Turquoise.DataAccess.EntityFramework.Mappings
{

    public class ContentHistoryMapping : EntityTypeConfiguration<ContentHistory>
    {
        public ContentHistoryMapping(string schema = "dbo")
        {
            ToTable(schema + ".ContentHistory");
            HasKey(x => x.Id);

            Property(x => x.Id).HasColumnName("Id").IsRequired().HasColumnType("int").HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity);
            Property(x => x.ContentId).HasColumnName("ContentId").IsRequired().HasColumnType("int");
            Property(x => x.ContentCategoryId).HasColumnName("ContentCategoryId").IsRequired().HasColumnType("int");
            Property(x => x.CreateDate).HasColumnName("CreateDate").IsRequired().HasColumnType("datetime");
            Property(x => x.CreatedBy).HasColumnName("CreatedBy").IsRequired().HasColumnType("int");
            Property(x => x.VersionNo).HasColumnName("VersionNo").IsRequired().HasColumnType("int");
            Property(x => x.RestoreVersionNo).HasColumnName("RestoreVersionNo").IsRequired().HasColumnType("int");
            Property(x => x.UpdateDate).HasColumnName("UpdateDate").IsRequired().HasColumnType("datetime");
            Property(x => x.UpdatedBy).HasColumnName("UpdatedBy").IsRequired().HasColumnType("int");
            Property(x => x.IsDeleted).HasColumnName("IsDeleted").IsRequired().HasColumnType("bit");
        }
    }

}

